(function(UB) {
	var paint = function() {
		console.log("Initial painting");
	};
	
	UB.Figure = function(sides, color) {
		this.sides = sides;
		this.color = color;
	};
	
	UB.Figure.prototype.paint = function(callback) {
		paint();
		console.log("Painting... ", this.sides, ":", this.color);
		setTimeout(function() {
			console.log("Painting finished");
			/*if ((callback) && (typeof callback.fn === "function") &&
					(typeof callback.scope === "object")) {
				callback.fn.call(callback.scope, true);
			}*/
			if (callback instanceof UB.Utils.Callback) {
				callback.execute("finished", true);
			}
		}, 3000);
	};
	UB.Figure.prototype.changeColor = function(color) {
		this.color = color;
		this._render();
	};
	UB.Figure.prototype.render = function() {
		console.log("Rendering... ", this);
	};
}(window.UB));